<div id="form"></div>
<script>

var arr=[
	{"type":"accordion","name":"blocks","mode":"blocks","label":"","pages":[{"id":"main-block","name":"Main information"}]},
	{
		type:"select",
		name:"fk",
		label:"<{>!Foregin keys<}>",
		values:[{id:"id",name:"<{>!IDs<}>"},{id:"name",name:"<{>!Names from other table, if 'name' column is available<}>"}],
		add_null:1,
		not_null:1,
		width:600,
		xpath:".main-block"
	},
	{
		type:"select",
		name:"old",
		label:"<{>!Non existing in import items<}>",
		values:[{id:"leave",name:"<{>!Leave<}>"},{id:"delete",name:"<{>!Delete from database<}>"}],
		add_null:1,
		not_null:1,
		width:600,
		xpath:".main-block"
	},
	{
		type:"select",
		name:"filetype",
		label:"<{>!File type<}>",
		values:[{id:"csv",name:"<{>!CSV<}>"},{id:"xml",name:"<{>!XML<}>"},{id:"xlsx",name:"<{>!XLSX<}>"},{id:"json",name:"<{>!JSON<}>"}],
		add_null:1,
		not_null:1,
		width:600,
		xpath:".main-block"
	},
	{
		type:"textedit",
		name:"missing_id",
		label:"<{>!Search by fields if missing ID<}>",
		values:'',
		add_null:1,
		not_null:0,
		width:600,
		xpath:".main-block"
	},
	{
		type:"file_id",
		name:"file",
		label:"<{>!File<}>",
		width:600,
		xpath:".main-block",
		noSelect: 1,
		noRemove: 1,
		allowUpload:true
	}
];

var frm=$("#form").ajajform({
	header: "<{>!{{mconfig.label}}<}>",
	submit: {
		url: '<{>action<}>',
		value: "<{>!Import<}>",
		params: {mode: "import2",ajaj: 1}
	}
});

ajajform_add_inputs(frm,arr);
</script>

